var tab = document.querySelector('.tobBox').querySelectorAll('li');
var list = document.querySelector('.content').querySelectorAll('li');

for (var i = 0; i < tab.length; i++) {
  tab[i].setAttribute('index', i);
  tab[i].onclick = function () {
    for (var i = 0; i < list.length; i++) {
      tab[i].className = '';
    }
    this.className = 'active';
    var index = this.getAttribute('index');
    console.log(index);
    for (var i = 0; i < tab.length; i++) {
      list[i].style.display = 'none';
    }
    list[index].style.display = 'block';
  }

}